<?php
/*
 * данный контроллер отвечает за работу главной страницы
 */
class Control_IndexAction extends Control_Action{
    public function setArgs($args = null) {
        if (null != $args){
            $this->args = $args;
        }
        return $this;
    }
    public function setView($view) {
        if (null != $view){
            $this->view = $view;
        }
        return $this;
    }
    public function run(){
        $t = Model_File::getSTime();
        $this->view->setInnerTemplate('index');
        $pho = new Model_UserMapper();
        $res = $pho->howManyPages();
        $this->view->paginator = Model_Paginator::howManyPages($res[0], 10);
        $this->view->photo = $pho->getTenUser($this->args['page'] );
        $_SESSION['time'] = Model_File::getTime($t);
        $_SESSION['memory'] = memory_get_usage();
        
    }
}
